home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Programming / EasyTools / EASYgfx < prev    next >
Text File  |  1996-12-13  |  6KB  |  163 lines

  1. /*
  2.  
  3. $VER: EASYgfx 1.0 (05.08.95) by David De Groot
  4.  
  5. This script works with 'gfx2ascii' in your c: dir
  6.  
  7. */
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14. signal on break_c
  15.  
  16. options failat 21 
  17.  
  18. NL = '0a'x
  19.  
  20. bool = exists('libs:rexxreqtools.library')
  21. if bool = 0 then say "You need RexxReqTools.library"
  22. else call addlib('rexxreqtools.library',0,-30)
  23.  
  24. gcheck = exists('c:gfx2ascii')
  25. if gcheck = 0
  26.     then do
  27.      call rtezrequest("GFX2ASCII is not in C:.",, 
  28.                       "Sorry!","ATTENTION!!",'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')
  29.     exit 
  30.   end
  31. else 
  32.  
  33. call rtezrequest("Do you want normal dithering" nl "or try the settings yourself?",,
  34.                  " Normal!|Let's try... ","Info",'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')
  35.  
  36. if rtresult == 1
  37.  then call def
  38.   else 
  39.    again:
  40.     dither =  rtgetstring("{#@08Oo+=-::..___}","Alter the default convertstring" nl,
  41.                           "to your likings..." nl "" nl,
  42.                           "(from left to right: dark -> light)" nl "" nl,
  43.                           "Note that you can not use blanks!" nl,
  44.                           "Keep the {} aswell!"," EASYgfx ",,
  45.                           "Press <Return>",'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')
  46.  
  47. if rtresult == 0 
  48.  then do
  49.        call rtezrequest("You should press the <Return> button" nl,
  50.                         "on the keyboard for the full effect." nl,
  51.                         "Please try again.",,
  52.                         "I will!", "Info", 'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')
  53.      
  54.        signal again
  55.       end
  56.  
  57. filename = rtfilerequest('ram:',,"Pick a picture to convert:", ,,
  58.                          'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')                                   
  59.  
  60. if rtresult == 0
  61.  then call rtezrequest("You picked no picture." nl, 
  62.                        "That ends this session I'm afraid!",,
  63.                        "Ok!","Heho!",'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')
  64.  
  65.   else do
  66.    width = rtgetlong("80","How many lines (width)" nl "" nl,
  67.                      "Height will be calculated keeping" nl,
  68.                      "the original aspect ratio of the" nl,
  69.                      "text image's width.","Enter number:", ,,
  70.                      'rt_reqpos=reqpos_centerscr rtgl_min = 1 rtgl_max = 512 rtez_flags=ezreqf_centertext')
  71.  
  72.  
  73.     if rtresult == 0
  74.      then call rtezrequest("You didn't specify the width." nl, 
  75.                            "That ends this session I'm afraid!",,
  76.                            "Ok!","Heho!",'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')
  77.       else do
  78.        oname = rtgetstring(,"Enter a name for the ASCIIfile" nl,
  79.                             "(File will be saved to Ram:)",
  80.                             "","EASYgfx",,
  81.                             "_Ok",'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')
  82.  
  83.         if rtresult == 0
  84.           then call rtezrequest("You didn't specify a name." nl, 
  85.                                 "That ends this session I'm afraid!",,
  86.                                 "Ok!","Heho!",'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')    
  87.  
  88.              else do
  89.               address command
  90.               'gfx2ascii ' || filename || ' -oRAM:' || oname || ' -w' || width || ' -d ' || dither || '' 
  91.  
  92.               say ""
  93.               say ""
  94.               say "That's quick! :-)   "
  95.               say ""
  96.  
  97.              end
  98.       end
  99.    end
  100. exit
  101.  
  102.  
  103.  
  104. def:
  105.  
  106. filename = rtfilerequest('ram:',,"Pick a picture to convert:", ,,
  107.                          'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')                  
  108.  
  109. if rtresult == 0
  110.  then call rtezrequest("You picked no picture." nl, 
  111.                        "That ends this session I'm afraid!",,
  112.                        "Ok!","Heho!",'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')
  113.  
  114.   else do
  115.    width = rtgetlong("80","How many lines (width)" nl "" nl,
  116.                      "Height will be calculated keeping" nl,
  117.                      "the original aspect ratio of the" nl,
  118.                      "text image's width.","Enter number:", ,,
  119.                      'rt_reqpos=reqpos_centerscr rtgl_min = 1 rtgl_max = 512 rtez_flags=ezreqf_centertext')
  120.                   
  121.     if rtresult == 0
  122.      then call rtezrequest("You didn't specify the width." nl, 
  123.                            "That ends this session I'm afraid!",,
  124.                            "Ok!","Heho!",'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')
  125.  
  126.       else do
  127.        oname = rtgetstring(,"Enter a name for the ASCIIfile" nl,
  128.                             "(File will be saved to Ram:)",
  129.                             "","EASYgfx",,
  130.                             "_Ok",'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')
  131.  
  132.             if rtresult == 0
  133.              then call rtezrequest("You didn't specify a name." nl, 
  134.                                    "That ends this session I'm afraid!",,
  135.            
  136.               else do
  137.                address command
  138.                'gfx2ascii ' || filename || ' -oRAM:' || oname || ' -w' || width || '' 
  139.  
  140.                say ""
  141.                say ""
  142.                say "That's quick! :-)   "
  143.                say ""
  144.  
  145.               end
  146.       end
  147.     end
  148. exit
  149.  
  150.  
  151.  
  152. break_c:       
  153.  
  154. call rtezrequest("You entered a break." || NL ||, 
  155.                  "This quits EASYgfx...!",,
  156.                  "Right!","Heho!",'rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext')    
  157.  
  158.  
  159.  
  160. /*  Futureplans: EXPAND! ;-) */
  161.  
  162.  
  163.